import ListItemBase from "sap/m/ListItemBase";
import Event from "sap/ui/base/Event";
import { BaseController } from "sap/ui/demo/nav/controller/BaseController";

/**
 * @namespace sap.ui.demo.nav.controller.employee
 */
export default class EmployeeList extends BaseController {
  onListItemPressed(oEvent: Event) {
    const oItem = oEvent.getSource() as ListItemBase;
    const oCtx = oItem.getBindingContext();
    this.router.navTo("employee", {
      employeeId: oCtx?.getProperty("EmployeeID"),
    });
  }
}
